<template>
	<view class="work-container">
		<!-- 宫格组件 -->
		<u-section title="我的工作" :right="false"></u-section>
		<view class="grid-body">
			<u-grid :border="false" >
				<u-grid-item v-for="(item,index) in menus" :key="index" :name="item.component"
					@click="gridItemClick(item,$event)">
					<!-- <u-icon :name="item.icon" color="green" size="60"></u-icon> -->
					<image :src="item.icon" class="local-icon"></image>
					<view style="margin-top: 5px;">{{ item.menuName }}</view>
				</u-grid-item>
			</u-grid>
		</view>
	</view>
</template>

<script>
	import constant from '@/utils/constant'
	export default {
		data() {
			return {
				show: true,
				current: 0,
				swiperDotIndex: 0,
				menus: uni.getStorageSync(constant.storageKey)[constant.menus] || []
			}
		},
		created() {
		},
		methods: {
			gridItemClick(item) {
				this.$tab.navigateTo(item.component)
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */

	.text {
		text-align: center;
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.grid-item-box {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
		;
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-box {
		height: 150px;
	}

	.swiper-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #fff;
		height: 300rpx;
		line-height: 300rpx;
	}

	@media screen and (min-width: 500px) {
		.uni-swiper-dot-box {
			width: 400px;
			/* #ifndef APP-NVUE */
			margin: 0 auto;
			/* #endif */
			margin-top: 8px;
		}

		.image {
			width: 100%;
		}
	}
	.local-icon {
	  width: 50px; /* 根据需要设置宽度 */
	  height: 50px; /* 根据需要设置高度 */
	}
</style>